package com.ashen.study.component;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author hxl
 * @Classname SchedulerTask
 * @Description 定时任务
 * @Date 2019/9/18 16:11
 */
@Component
public class SchedulerTask {
//
//    private int count=0;
//
//    @Scheduled(cron="*/6 * * * * ?")
//    private void process(){
//        System.out.println("猛男this is scheduler task runing  "+(count++));
//    }
//
//    private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
//
//    @Scheduled(fixedRate = 8000)
//    public void reportCurrentTime() {
//        System.out.println("现在时间：" + dateFormat.format(new Date()));
//    }

}
